package cn.miao.exception;

/**
 * 自定义异常
 *
 * @author MiaoDaWei
 * @date 2021/09/23
 */
public class MiaoRuntimeException extends RuntimeException {
    /**
     * 序列化id
     */
    private static final long serialVersionUID = 1L;

    /**
     * 状态码
     */
    private Integer code;

    /**
     * 消息
     */
    private String message;

    public MiaoRuntimeException(String message)
    {
        this.message = message;
    }

    public MiaoRuntimeException(String message, Integer code)
    {
        this.message = message;
        this.code = code;
    }

    public MiaoRuntimeException(String message, Throwable e)
    {
        super(message, e);
        this.message = message;
    }

    @Override
    public String getMessage()
    {
        return message;
    }

    public Integer getCode()
    {
        return code;
    }
}